﻿using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace WeatherHistory.Api.Controllers;

/// <summary>
///     Контроллер для проверки работоспособности API
/// </summary>
[AllowAnonymous]
[Route("health-check")]
public class HealthCheckController : ApiControllerBase
{
    /// <summary>
    ///     Проверяет живой ли сервис
    /// </summary>
    /// <returns>"OK!"</returns>
    [HttpGet]
    [ProducesResponseType(typeof(string), StatusCodes.Status200OK)]
    public async Task<ActionResult<string>> Get()
    {
        await Task.Delay(500);
        return Ok("OK!");
    }
}